Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
JS: variable declarada con let, pero obtuvo un error "indefinido" al llamarlo

Lo siento si esta pregunta es estúpida, normalmente no estoy haciendo nada de frontend y soy un novato con JS.

En Firefox DevTools veo el siguiente mensaje de error:

 Uncaught TypeError: tabHeader is undefined

Tengo el siguiente código:

 let tabHeader=document.getElementsByClassName('tab-header')[0]; let tabsPane=tabHeader.getElementsByTagName('div');

Declaré una variable usando let, pero todavía se lee como "indefinida"; Además, si uso consol.log(tabHeader) también obtengo una salida undefined en la consola. Estoy seguro de que esto es fácil y solo estoy siendo un novato, pero ¿qué estoy haciendo mal aquí?

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!